#ifndef __QT_IP_DIALOG__
#define __QT_IP_DIALOG__

#include <QButtonGroup>
#include <QDialog>
#include <QDialogButtonBox>
#include <QHBoxLayout>
#include <QHeaderView>
#include <QLabel>
#include <QLineEdit>
#include <QSpacerItem>
#include <QVBoxLayout>
#include <QWidget>

typedef struct tag_ipaddress_result
{
  QString  addr;
  int      port;
}ipaddress_result;

class IPDialog : public QDialog
{

    Q_OBJECT
public:
    explicit IPDialog(QWidget *parent = 0);

    virtual void buildWidget(const QString &addr, const int &port=0);


signals:
    void ipaccept(ipaddress_result);

public slots:
    virtual void accept();
    virtual void reject ();

protected:
    QVBoxLayout      *verticalLayout;
    QLabel           *titleWidget;
    QSpacerItem      *titleaddressSpacer;
    QHBoxLayout      *horizontalLayout;
    QSpacerItem      *leftSpacer;
    QLineEdit        *ipAddressWidget;
    QLabel           *addressseparator;
    QLineEdit        *portWidget;
    QSpacerItem      *rightSpacer;
    QSpacerItem      *buttonaddresSpacer;
    QDialogButtonBox *buttonBox;


};

#endif
